<?php
namespace miniapp\cpmin\model;

use think\Db;
use think\Model;
use think\model\concern\SoftDelete;

class Cpminilist extends Model{
    use SoftDelete;
    protected $deleteTime = 'delete_time';
    protected $autoWriteTimestamp = 'datetime';

    public function mpfriends(){
        return $this->belongsTo('MiniappUser','openid','openid')
            ->bind('relname,mobile');
    }

    public function getStatusAttr($value){
        $status = [0=>'待处理',1=>'中奖',2=>'未中奖',3=>'错误',4=>'已兑奖'];
        return $status[$value];
    }
}
